<?php ?>
<div class="form_details">
	<div class="space30"></div>
	<!--form_container starts-->
	<div class="form_container">
		<h4 style="background-color:#FF8200 !important;color:#ffffff !important;">
			<?php if(isset($form_detail[0]['event_name'])){ echo "Application for ".$form_detail[0]['event_name'].' - ';} ?>
			<?php if(isset($form_detail[0]['award_name'])){ echo $form_detail[0]['award_name'];} ?>
		</h4>
	</div>
	<!--form_container starts-->
	<div class="space10"></div>
	<!--form_container starts-->
	
	<!------------------------------------------Personal Info------------------------------->
	<?php echo form_open_multipart(BASE_URL . '/user/add_user_application', array('id' => 'user_application_doc_form', 'method' => 'post')); ?>
	<?php if(isset($form_list_doc) && !empty($form_list_doc)){
			foreach($form_list_doc as $key => $temp)
			{
				if(isset($temp['master_application_form_subcategory']) && $temp['master_application_form_subcategory'] == 'Documents')
				{
					$personal[$key]['id']=$temp['event_application_form_id'];
					$personal[$key]['f_id']=$temp['event_application_form_field_id'];
					$personal[$key]['name']=$temp['master_application_form_name'];
					$personal[$key]['input_type']=$temp['master_application_form_type'];
					$personal[$key]['label']=$temp['event_application_form_label'];
					$personal[$key]['man']=$temp['event_application_form_mandatory'];
					$personal[$key]['type_extra']=$temp['master_application_form_extra'];
				}
			}
	?>
	<div class="form_container">
		<h4>Attachment - Supporting Documents</h4>
		<?php
			for($i=0;$i<=ceil(count($personal)/2);$i++)
			{
				$n = $i*2;
				$m = $n+1;
		?>
			<!--row starts-->
			<div class="row1">
				<?php if(isset($personal[$n]['label'])){ ?>
				<div class="form-group col-sm-6">
					<label><?php echo $personal[$n]['label']; ?> <?php if($personal[$n]['man'] == 'Yes') echo "<span class='asterisk'>*</span>"; ?></label>
                       <?php $data_ap = 'user_application_field'.$personal[$n]['f_id'];?>
					<?php if(isset($personal[$n]['input_type'])){
						if($personal[$n]['input_type'] == 'input'){?>
							<input class="form-control white" id="<?php echo $personal[$n]['name']; ?>" name="<?php echo $personal[$n]['name']; ?>"  type="text" 
					<?php if($personal[$n]['man'] == 'Yes') echo 'required'; ?> value="<?php if(isset($user_data[0]->$data_ap)) { echo $user_data[0]->$data_ap; }?>">
					<?php } if($personal[$n]['input_type'] == 'upload'){?>
							<input class="form-control white" id="<?php echo $personal[$n]['name']; ?>" name="<?php echo $personal[$n]['name']; ?>"  type="file" />
					<?php }if(isset($user_data[0]->$data_ap)) { echo substr($user_data[0]->$data_ap,54); }}?>
					<div class="error_msg" id="err-<?php echo $personal[$n]['name']; ?>"></div>
				</div>
				<?php } ?>
				<?php if(isset($personal[$m]['label'])){ ?>
				<div class="form-group col-sm-6">
					<label><?php echo $personal[$m]['label']; ?> <?php if($personal[$m]['man'] == 'Yes') echo "<span class='asterisk'>*</span>"; ?></label>
                       <?php $data_ap = 'user_application_field'.$personal[$m]['f_id'];?>
					<?php if(isset($personal[$m]['input_type'])){ 
						if($personal[$m]['input_type'] == 'input'){?>
							<input class="form-control white" id="<?php echo $personal[$m]['name']; ?>" name="<?php echo $personal[$m]['name']; ?>"  type="text" 
							<?php if($personal[$m]['man'] == 'Yes') echo 'required'; ?> value="<?php if(isset($user_data[0]->$data_ap)) { echo $user_data[0]->$data_ap; }?>">
						<?php } if($personal[$m]['input_type'] == 'upload'){?>
							<input class="form-control white" id="<?php echo $personal[$m]['name']; ?>" name="<?php echo $personal[$m]['name']; ?>"  type="file" />
					<?php } if(isset($user_data[0]->$data_ap)) { echo  substr($user_data[0]->$data_ap,54); }}?>
					<div class="error_msg" id="err-<?php echo $personal[$m]['name']; ?>"></div>
				</div>
               	
				<?php } ?>
				<div class="clearfix"></div>
			</div>
			<!--raw closed-->
		<?php }?>
	</div>
	<!--form_container starts-->
	<div class="space30"></div>
	<!--form_container starts-->
	<input type="hidden" name="app_award_id" value="<?php if(isset($form_detail[0]['award_id'])){ echo $form_detail[0]['award_id'];} ?>" />
	<input type="hidden" name="app_type" value="document" />
	<input type="hidden" name="app_applicant_id" value="<?php echo $this->session->userdata('user_id'); ?>" />
	<input type="hidden" name="app_applicant_refree" value="<?php if(isset($form_detail[0]['award_refree_count'])){ echo $form_detail[0]['award_refree_count'];}?>" />
	<button type="button" class="btn btn-primary" id="applicant_form_submit_doc">
		Save & Continue
	</button>
	<?php }?>
	<?php echo form_close(); ?>
</div>